package com.mall4j.cloud.api.coupon.bo;

import com.mall4j.cloud.common.order.vo.ShopCartOrderMergerVO;

/**
 * 满减劵模版
 * @author ljh
 */
public class FullReduceCoupon extends CouponBO{
    private long minPrice;
    private long discount;

    public FullReduceCoupon(long minPrice, long discount) {
        this.minPrice = minPrice;
        this.discount = discount;
    }

    @Override
    public boolean canUse(CouponUseContext context) {
        return context.getTotal()>=minPrice;
    }

    @Override
    public long applyDiscountInternal(CouponUseContext context) {
        return discount;
    }

    @Override
    public String toString() {
        return "FullReduceCoupon{" +
                "minPrice=" + minPrice +
                ", discount=" + discount +
                '}';
    }
}
